import request from '@/config/axios'
import type { Dayjs } from 'dayjs';

/** 医生信息 */
export interface Doctor {
          id: number; // 医生ID
          name?: string; // 名称
          avatar?: string; // 头像
          postName?: string; // 医生职务
          beGoodAt?: string; // 医生擅长
          briefInfo?: string; // 医生简介
          detail?: string; // 医生详情
  }

// 医生 API
export const DoctorApi = {
  // 查询医生分页
  getDoctorPage: async (params: any) => {
    return await request.get({ url: `/business/doctor/page`, params })
  },

  // 查询医生详情
  getDoctor: async (id: number) => {
    return await request.get({ url: `/business/doctor/get?id=` + id })
  },

  // 新增医生
  createDoctor: async (data: Doctor) => {
    return await request.post({ url: `/business/doctor/create`, data })
  },

  // 修改医生
  updateDoctor: async (data: Doctor) => {
    return await request.put({ url: `/business/doctor/update`, data })
  },

  // 删除医生
  deleteDoctor: async (id: number) => {
    return await request.delete({ url: `/business/doctor/delete?id=` + id })
  },

  /** 批量删除医生 */
  deleteDoctorList: async (ids: number[]) => {
    return await request.delete({ url: `/business/doctor/delete-list?ids=${ids.join(',')}` })
  },

  // 导出医生 Excel
  exportDoctor: async (params) => {
    return await request.download({ url: `/business/doctor/export-excel`, params })
  },
}